package com.eling.elcms.travel.model;

import com.eling.elcms.basedoc.model.OrgBuilding;
import com.eling.elcms.core.model.BaseModel;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;

import javax.persistence.*;

/**
 * 目的地所属楼宇
 * 
 * @author zhoulin
 *
 */
@Entity
@Table(name = "travel_destnbuilding")
@Indexed
public class DestnBuilding extends BaseModel {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2655249291563842714L;

	@Id
	@DocumentId
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long pkDestnBuilding;

	/** 目的地 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkDestination")
	@IndexedEmbedded(depth = 1)
	private Destination destination;

	/** 楼宇 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkOrgBuilding")
	@IndexedEmbedded(depth = 1)
	private OrgBuilding orgBuilding;

	@Version
	private Integer version;

	public Long getPkDestnBuilding() {
		return pkDestnBuilding;
	}

	public void setPkDestnBuilding(Long pkDestnBuilding) {
		this.pkDestnBuilding = pkDestnBuilding;
	}

	public Destination getDestination() {
		return destination;
	}

	public void setDestination(Destination destination) {
		this.destination = destination;
	}

	public OrgBuilding getOrgBuilding() {
		return orgBuilding;
	}

	public void setOrgBuilding(OrgBuilding orgBuilding) {
		this.orgBuilding = orgBuilding;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

}
